<%@ page language="java" import="java.util.*,java.sql.*,dom.util.Connections,com.mysql.jdbc.Connection" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>招贤纳士</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <link rel="stylesheet" href="<%=path%>/source/JS/css/layui.css"  media="all">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
         <%
          Connection conn =Connections.getConnection();
          String sql="select  *  from  recruitment";  
          PreparedStatement  pstmt = conn.prepareStatement(sql); 
          ResultSet rs=pstmt.executeQuery();  
          rs.last(); //移至最后一条记录 
         %>
         <center>

	     <div style="padding: 20px; background-color: #F2F2F2; width:80%" >
	      <div class="layui-row layui-col-space5" style="margin-left:20%">
	        <div class="layui-col-md8">
	          <div class="layui-card">
	          	<center>
	          		<h1>人员招聘信息</h1>
	          	</center>
	          
	            <div class="layui-card-header">
	           	  共有<font size="5" color="red"> <%=rs.getRow()%></font>个岗位
	            </div>
     	        <div class="layui-card-header">
         			<table border="1"  height="40" class="layui-table">
		               <tr bgcolor="CCCCCC" align="center">
		                   <td width="20%" >ID</td> <td width="20%" >职位名称</td> <td width="20%" >职位描述</td><td width="20%" >职位要求</td>
		               </tr>
		           </table>
	            </div>   
		          <form>
		          <table  border="1"  class="layui-table">
		             <% rs.beforeFirst();//移至第一条记录之前
             			while(rs.next()){
         			 %> 
		          		<tr align="center" height="40">
		                  <td width="20%" ><%= rs.getRow()%></td>
		                  <td width="20%" ><%= rs.getString("title")%></td>
            			  <td width="20%" ><%= rs.getString("job_describe")%></td>
 		                  <td width="20%" ><%= rs.getString("requirement")%></td>
		                </tr>            
		             <% }%>
		           </table>
	         	   </form>
	          </div>
	        </div>
	      </div>
	    </div>
        </center>
        <% Connections.closeDB(conn,pstmt,rs);%> 
  </body>
</html>